package com.liyuhan.onlinetaxibackground.Repository;

import com.liyuhan.onlinetaxibackground.POJO.Comment;
import com.liyuhan.onlinetaxibackground.POJO.CompletedOrder;
import com.liyuhan.onlinetaxibackground.POJO.Driver;
import com.liyuhan.onlinetaxibackground.POJO.Passenger;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface CommentRepository extends JpaRepository<Comment, Integer> {
    Optional<List<Comment>> findCommentsByOrder(CompletedOrder order);

    Optional<List<Comment>> findCommentsByStateAndPassenger(String state, Passenger passenger);

    Optional<List<Comment>> findCommentsByStateAndDriver(String state, Driver driver);
}
